package com.tianji.api.client.remark.fallback;

import com.tianji.api.client.remark.RemarkClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.ArrayList;
import java.util.List;
@Slf4j
public class RemarkFallbackFactory implements FallbackFactory<RemarkClient> {
    @Override
    public RemarkClient create(Throwable cause) {
        return new RemarkClient() {
            @Override
            public List<Long> isBizLiked(List<Long> bizIds, String bizType) {
                log.error("远程调用remark服务异常", cause);
                return new ArrayList<>();
            }
        };
    }
}